local thbattle__xiaowan_fusangshen = fk.CreateSkill {

  name = "thbattle__xiaowan_fusangshen",

  tags = {  },

}



thbattle__xiaowan_fusangshen:addEffect(fk.BeforeCardsMove, {
  prompt = "#thbattle__xiaowan_fusangshen",
  anim_type = "offensive",
  priority=1.5,
  can_trigger = function(self, event, target, player, data)
    if not player:hasSkill(thbattle__xiaowan_fusangshen.name) then return end
    for _, move in ipairs(data) do
      if move.from and move.from ~= player and not move.from.dead and move.toArea==Card.DiscardPile then
        for _, info in ipairs(move.moveInfo) do
          if info.fromArea == Card.PlayerEquip then
            return true
          end
        end
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    for _, move in ipairs(data) do
      if move.from and move.from ~= player and not move.from.dead and move.toArea==Card.DiscardPile then
        for _, info in ipairs(move.moveInfo) do
          if info.fromArea == Card.PlayerEquip then
            local judge = {
              who = player,
              reason = thbattle__xiaowan_fusangshen.name,
              pattern = ".|9~13",
            }
            player.room:judge(judge)
            if judge.card.number >= 9 then
              player.room:damage({
                from = player,
                to = move.from,
                damage = 1,
                skillName = thbattle__xiaowan_fusangshen.name
              })
            end
          end
        end
      end
    end
  end,
})

return thbattle__xiaowan_fusangshen